package com.situ.day22.generic;

import com.situ.day21.reflect.Student;
import com.situ.day5.Teacher;
import org.junit.Test;

public class GenericDemo2 {

    public Student save1(Student student, Teacher teacher) {
        return null;
    }

    public <K,T> K save(K k, T t) {
        return k;
    }

    @Test
    public void test1() {
        // 使用泛型方法:  在使用泛型方法的时候，确定泛型类型
        Float result1 = save(1.0f, 1);
        System.out.println(result1);

        String result2 = save("abc", 1);
        System.out.println(result2);
    }
}
